package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.model.product.SkuImage;
import com.atguigu.gmall.model.product.SkuInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;

@RequestMapping("/api/inner")
@FeignClient(name = "service-product")
public interface SkuInfoFeignClient {


    /**
     * 获取商品sku的info
     * @param skuId
     * @return
     */
    @GetMapping("/skuinfo/{skuId}")
    SkuInfo getSkuInfo(@PathVariable("skuId")Long skuId);

    /**
     * price-价格
     * @param skuId
     * @return
     */
    @GetMapping("/sku/price/{skuId}")
    BigDecimal getSkuPrice(@PathVariable("skuId")Long skuId);

    /**
     * 获取商品sku的info中的图片
     * @param skuId
     * @return
     */
    @GetMapping("/skuinfo/images/{skuId}")
    List<SkuImage> getSkuInfoimages(@PathVariable("skuId")Long skuId);
}
